/*
 * planner_lookahead.h
 *
 * Copyright 2011 Pieter Agten
 *
 * This file is part of Yarf.
 *
 * Yarf is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Yarf is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Yarf.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @file   planner_lookahead.h
 * @author Pieter Agten (pieter.agten@gmail.com)
 * @date   5 nov 2011
 * @brief  The lookahead component tries to keep the speed at which movements
 *         are made as high as possible. That is, it tries to raise the entry
 *         and exit speeds of blocks, while at the same time preventing jerky
 *         movement. The code is based on chamnit's fork of Grbl 
 *         (https://github.com/chamnit/grbl).
 */

#ifndef PLANNER_LOOKAHEAD_H
#define PLANNER_LOOKAHEAD_H

#include "block.h"

/**
 * Initializes the lookahead component
 */
void plan_lookahead_init(void);

/**
 * Updates the motion plan for the entire planning queue, to account for the
 * additional contraints on the motion plan, imposed by the last block that was
 * added to the queue.
 *
 * To use the lookahead component, this method should be called right after
 * adding a new block to the planning queue.
 *
 * The lookahead component tries to keep the speed in between blocks as high
 * as possible, without causing jerky movement at the junctions between blocks.
 */
void plan_lookahead(void);

#endif //PLANNER_LOOKAHEAD_H
